# 简化的Java版本检查脚本
Write-Host "检查当前 Java 环境..." -ForegroundColor Green

Write-Host "JAVA_HOME: $env:JAVA_HOME" -ForegroundColor Cyan

Write-Host "Java 版本:" -ForegroundColor Yellow
try {
    java -version
} catch {
    Write-Host "无法检测 Java 版本" -ForegroundColor Red
}

Write-Host "Maven 版本:" -ForegroundColor Yellow
try {
    mvn -version
} catch {
    Write-Host "无法检测 Maven 版本" -ForegroundColor Red
}

Write-Host "已安装的 Java 版本:" -ForegroundColor Yellow
Get-ChildItem "C:\Program Files\Eclipse Adoptium\" -ErrorAction SilentlyContinue | ForEach-Object {
    Write-Host "  - $($_.Name)" -ForegroundColor Cyan
}